<script lang="ts" setup>
import {ref} from 'vue'
import CisTable from '@/packages/library/CisTable/index.vue'

const tableData = ref([
  {
    date: '2016-05-03',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-02',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-04',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  }, {
    date: '2016-05-01',
    name: 'Jack',
    address: 'No. 189, Grove St, Los Angeles',
  }
])

/**
 * 可勾选条件
 * @param item 行数据
 */
const filterSelection = (item: any) => {
  return item.name === 'Jack';
}
</script>
<template>
  <div class="justify-center flex justify-center mt-100px">
    <div class="w-800px h-300px flex">
      <CisTable
          :data="tableData"
          customData
          selection
          :formConfig="{a:{}}"
          :filterSelection="filterSelection"
      >
        <template #topSearch>
          <div>9999</div>
        </template>
        <el-table-column prop="date" label="Date" width="180"/>
        <el-table-column prop="name" label="Name" width="180"/>
        <el-table-column prop="address" label="Address"/>
      </CisTable>
    </div>
  </div>
</template>
